'''
Created on Sep 30, 2010

@author: david
'''

from pspy.der import PspyAction

class WorxAction(PspyAction):
    
    def __int__(self,req=0):
        PspyAction.__init__(self,req)
        
    def execute(self):
        return self.safeExecute()
    
    def safeExecute(self):
        req = self.request
        try:
            # try the good path
            rtn = self._execute(req)
        except Exception, e:
            req.setAttribute("errorCode","500")
            req.setAttribute("errorMessage",str(e))
            nxtPage = "appError.kid"
        
            # done
            req.setResponsePage(nxtPage)
            rtn = req.getResponse()
            
        return rtn
    
    def _execute(self,req):
        pass
    
if __name__ == '__main__':
    pass